public class Main {
    public static void main(String[] args) {
        // 使用圆形工厂创建对象
        ShapeFactory circleFactory = new CircleFactory();
        Shape circle = circleFactory.createShape();
        circle.draw();  // 输出: 绘制圆形

        // 使用矩形工厂创建对象
        ShapeFactory rectangleFactory = new RectangleFactory();
        Shape rectangle = rectangleFactory.createShape();
        rectangle.draw();  // 输出: 绘制矩形
    }
}
